/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package datos;
import java.sql.*;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.DriverManager;
/**
 *
 * @author sistemas
 */
public class TDatos_sql
{
    protected Connection cn;
    protected Statement st;
    Connection com=null;
    public TDatos_sql()
    {
        String url="";
        try
        {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            cn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","upds2014");
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());            
        }
    }
    public boolean Ejecutar(String strsql) throws SQLException{
        this.st=this.cn.createStatement();
        return (this.st.executeUpdate(strsql)>0);
    }
    public ResultSet Seleccionar(String strcad)throws SQLException{
        this.st=this.cn.createStatement();
        return (this.st.executeQuery(strcad));
    }
}
